package com.yb0os1.controller.user;

import com.yb0os1.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("userShopController")
@RequestMapping("/user/shop")
@Tag(name = "店铺相关接口")
public class ShopController {
    @Autowired
    private RedisTemplate redisTemplate;
    private final String SHOP_STATUS = "SHOP_STATUS";

    @Operation(summary = "查询店铺营业状态")
    @GetMapping("/status")
    public Result<Integer> getStatus(){
        return Result.success((Integer) redisTemplate.opsForValue().get(SHOP_STATUS));
    }
}
